import 'package:flutter/widgets.dart';
import 'package:mobile_app.home.core/core/presentation/localization/translation.dart';
import 'package:mobile_app.home.core/core/presentation/models/lexical_item_progress_model/lexical_item_progress_model.dart';

String buildLexicalItemProgressInfo({
  required LexicalItemProgressModel progressModel,
  required BuildContext context,
}) {
  switch (progressModel) {
    case ExcludedLexicalItemProgressModel():
      return HomeCoreTranslation.of(context).excludedLexicalItemProgressInfo;

    case UnspecifiedLexicalItemProgressModel():
      return HomeCoreTranslation.of(context).unspecifiedLexicalItemProgressInfo;

    case PreviouslyKnownLexicalItemProgressModel():
      return HomeCoreTranslation.of(context).previouslyKnownLexicalItemProgressInfo;

    case LearningLexicalItemProgressModel():
      if (progressModel.progressPercent == 100) {
        return HomeCoreTranslation.of(context).completelyLearnedProgressInfo;
      }

      return HomeCoreTranslation.of(context).getLearningProgressInfo(
        progressPercent: progressModel.progressPercent,
      );
  }
}
